<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <title>资质审核项目列表</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1>资质审核项目列表</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">招标采购管理</a></li>
            <li class="active"><a href="#">资质审核项目列表</a></li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
                    <div class="form-group form-group-xs">
                        <label for="txtDrugName">项目编号：</label>
                        <input class="form-control" type="text" id="projCode" name="projCode" placeholder="项目编号" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">项目名称：</label>
                        <input class="form-control" type="text" id="name" name="name" placeholder="项目名称" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">项目状态：</label>
                        <select class="form-control"  id="status" name="status">
                        	<option value="">请选择</option>
                        	<option value="1">启用</option>
                        	<option value="0">停用</option>
                        </select>
                    </div>
                    <button type="button" onclick="gridSerch()" class="btn btn-success btn-sm">查询</button>
                </div>
            </div>
        </div>

        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>

        <%-- <div class=" box box-warning bottongroup">
            <a href='${ctx}/bidProject/toSaveOrUpdate.html' class="btn btn-default btn-sm">新增</a>
        </div> --%>
    </section>
    <form action="${ctx}/bidProjCompany/toList.html" method="post" id="Form">
    <input type="hidden" name="projId" id="projId">
    <input type="hidden" name=newname id="newname">
    </form>
     <form action="${ctx}/bidProject/toHospList.html" method="post" id="FormAddhosp">
    <input type="hidden" name="projIdAddhosp" id="projIdAddhosp">
    <input type="hidden" name="name" id="name">
    </form>
      <form action="${ctx}/bidProject/toCompList.html" method="post" id="FormAddcomp">
    <input type="hidden" name="projIdAddcomp" id="projIdAddcomp">
    <input type="hidden" name="compName" id="compName">
    </form>
    <%@ include file="/WEB-INF/component/commonJS.jsp" %>
    <script type="text/javascript">
        $(function () {
            $("#gridlist").jqGrid({
                url: "${ctx}/bidProject/getDataList.html",
                mtype: "POST",
                datatype: "json",
                autowidth: true,
                shrinkToFit:false,
                height: 270,
                colNames: ['projId', '采购项目编号', '项目名称','项目简介','采购开始日期','采购结束日期','项目类型','备注', '项目状态','操作'],
                colModel: [
                    { name: 'projId', key:true,hidden:true,width: 40, align: 'center' ,sortable: false},
                    { name: 'projCode', width: 120, align: 'center' ,sortable: false},
                    { name: 'name', width: 130, align: 'center' ,sortable: false},
                    { name: 'projIntro', width: 130, align: 'center' ,sortable: false},
                    { name: 'starttime', width: 120, align: 'center' ,sortable: false},
                    { name: 'endtime', width: 120, align: 'center' ,sortable: false},
                    { name: 'projCat', width: 120, align: 'center' ,sortable: false,
                    	formatter : function(val, opts,rowdata) {
    						if (val == 1) {
    							return "招标采购";
    						} else if (val == 2) {
    							return "谈判采购";
    						}else if (val == 3) {
    							return "定点生产";
    						}else if (val == 4) {
    							return "直接采购";
    						}
    				}},
                    { name: 'remark', width: 100, align: 'center' ,sortable: false},
                    { name: 'status', width: 80, align: 'center' ,sortable: false,
						formatter : function(val, opts,rowdata) {
							if (val == 1) {
								return "启用";
							} else if (val == 0) {
								return "停用";
							}
					}},
                    { name: 'operate', width: 200, align: 'center' ,sortable: false,
                    	formatter: function (val, opts, rowdata) {
                    		var str ="";
                    		str += "<a href='${ctx}/bidProject/toCompprofileCompList.html?projId="+rowdata.projId+"'>已申报资质企业</a>";
                    		str += "<a href='${ctx}/bidProject/toDeclareDrugByCompList.html?projId="+rowdata.projId+"'>已申报药品企业</a>";
                    		str += "<a href='${ctx}/bidProject/toAuditDrugCompprofileByDrugList.html?projId="+rowdata.projId+"'>药品申报审核</a>";
                    		return str;
                    	}	  }
                   
                ],
                rowNum: 20,
                rowList: [10, 20, 50, 100],
                rownumbers: true,
                pager: "#gridpage",
                viewrecords: true,
                caption: "资质审核项目列表",
                jsonReader: {
                    repeatitems: false  
                },
                loadComplete: function (data) { //完成服务器请求后，回调函数
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
            moreNoMore();
        });
        //查询
        function gridSerch() {
        	var projCode = $("#projCode").val();
        	var name = $("#name").val();
        	var status = $("#status").val();
    		$("#gridlist").jqGrid('setGridParam',{  
    	        datatype:'json',
    	        postData:{"projCode":projCode,
    	        		"name":name,
    	        		"status":status}
    	    }).trigger("reloadGrid"); //重新载入  
    	}
      
       
        
        
        
        
    </script>
</body>
</html>